#pragma once
#include "DXAMLCommon.h"

class CMediaQueue;
class CMediaQueueManagerItem;


class CMediaQueueManager
{
public: 
	static HRESULT Create(CMediaQueueManager * * ppQueueManager);
	virtual ~CMediaQueueManager();
	HRESULT CreateMediaQueue(struct IMediaQueueClient * pClient, struct ICoreServices * pCore, CMediaQueue * * ppQueue);
	HRESULT ProcessQueues(XUINT32 bIsShuttingDown);

protected: 
	CMediaQueueManager();
	HRESULT Initialize();
	HRESULT Shutdown();
	HRESULT AddMediaQueue(CMediaQueue * pQueue);
	HRESULT RemoveMediaQueue(CMediaQueue * pQueue);
	struct IPALCriticalSection * m_pLock;
	CMediaQueueManagerItem * m_pHead;
	CMediaQueueManagerItem * m_pTail;
	XUINT32 m_fShutdown;
};
